// 导入 
import BaseAPI from './baseapi'
import request from '../utils/request';


// 继承类
class StaffApi extends BaseAPI{

    constructor(appname:string, name: string) {
       super(appname, name);
    }

    // 当前类定义的函数 
    public chStatus = (id:any,data:any) => {
        return request({
            method: 'post',
            url: `${this.appname}/${this.name}/${id}/ch/status/`,
            data
        })
    }

    // 员工的登陆 
    public login = (data:any) => {
        return request({
            method: 'post',
            url: `${this.appname}/login/`,
            data
        })

    }
    // 获取验证码 
    public getimage = () =>{
        return request({
            method: 'get',
            responseType: 'blob', // 表示二进制的数据！
            url: `${this.appname}/login/image/code/`,
        })
    }

    // 获取员工的下拉框数据
    public getAllSelect = () =>{
        return request({
            method: 'get',
            url: `${this.appname}/${this.name}/select/`,
        })
    }
    
    // 获取相应分部下的员工 
    public getBranchSelect = (data:any) =>{
        return request({
            method: 'post',
            url: `${this.appname}/${this.name}/select/branch/`,
            data
        })
    }


}


export default StaffApi